const { mysql } = require('../qcloud')

module.exports = async ctx => {

  var reqParam = ctx.request.body;  

  var id = 5;
  // 增
  var book = {
    id: id,
    name: 'malcolm',
    price: 88
  }
  await mysql("book").insert(book);
  // 查
  var res = await mysql("book").where({ id }).first();
  // 改
  await mysql("book").update({ price: 66 }).where({ id });
  // 删
  // await mysql("book").del().where({ id });

  ctx.state.data = reqParam
}